using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IceBlockController : MonoBehaviour
{

    public float meltTime;
    private Character character;
    private Rigidbody2D rigidbody2d;
    void Start()
    {
        character = transform.parent.GetComponentInParent<Character>();
        rigidbody2d = transform.parent.GetComponentInParent<Rigidbody2D>();
    }

    // Update is called once per frame
    void Update()
    {
        rigidbody2d.velocity = Vector2.zero;
        if (--meltTime <= 0 )
        {
            character.Dizziness = false;
            Destroy(gameObject);
        }
        else if(character.Dizziness == false)
        {
            Destroy(gameObject);
        }

    }
}
